home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / SH / STD / STDC / FPRINTF.C < prev    next >
C/C++ Source or Header  |  1992-07-13  |  732b  |  62 lines

  1. /*
  2.  * printf and fprintf
  3.  */
  4.  
  5. /* $Header */
  6.  
  7. #if __STDC__
  8. #include <stdarg.h>
  9. #else
  10. #include <varargs.h>
  11. #endif
  12. #include <stdio.h>
  13.  
  14. #if _V7 || _BSD
  15.  
  16. /* printf to stdout */
  17. int
  18. #if __STDC__
  19. printf(Const char *fmt, ...) {
  20. #else
  21. printf(va_alist) va_dcl
  22. {
  23.     char *fmt;
  24. #endif
  25.     va_list va;
  26.  
  27. #if __STDC__
  28.     va_start(va, fmt);
  29. #else
  30.     va_start(va);
  31.     fmt = va_arg(va, char *);
  32. #endif
  33.     vfprintf(stdout, fmt, va);
  34.     va_end(va);
  35.     return 0;
  36. }
  37.  
  38. int
  39. #if __STDC__
  40. fprintf(FILE *f, Const char *fmt, ...) {
  41. #else
  42. fprintf(va_alist) va_dcl
  43. {
  44.     FILE *f;
  45.     char *fmt;
  46. #endif
  47.     va_list va;
  48.  
  49. #if __STDC__
  50.     va_start(va, fmt);
  51. #else
  52.     va_start(va);
  53.     f = va_arg(va, FILE *);
  54.     fmt = va_arg(va, char *);
  55. #endif
  56.     vfprintf(f, fmt, va);
  57.     va_end(va);
  58.     return 0;
  59. }
  60.  
  61. #endif
  62.